"""electricity_supplier_project URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include, re_path
import xadmin
from django.views.static import serve
from rest_framework.documentation import include_docs_urls

from .settings import MEDIA_ROOT

urlpatterns = [
    # path('admin/', admin.site.urls),
    path('xadmin/', xadmin.site.urls),
    re_path('^media/(?P<path>.*)', serve, {"document_root": MEDIA_ROOT}),
    # path('docs/', include_docs_urls(title='商城文档')),  # 自动化文档
    # path('ckeditor/', include('ckeditor_uploader.urls')),  # 富文本相关url
    path('', include("areas.urls")),  # 地区子路由
    path('', include("goods.urls")),  # 商品子路由
    path('', include("users.urls")),  # 用户子路由
    path('', include("carts.urls")),  # 购物车子路由
    path('', include("orders.urls")),  # 订单子路由
    path('', include("logistics.urls")),  # 物流子路由
    path('', include("usercount.urls")),  # 物流子路由
    # 后台运营部分
    path('api-auth/', include('rest_framework.urls')),  # 页面添加登录，登出按钮
    path('operator/', include("operator_goods.urls")),  # 商品后台子路由
    path('operator_orders/', include("operator_orders.urls")),  # 订单后台子路由
    path('operator/', include("operator_log.urls")),  # 操作日志后台子路由
    path('operator/', include("operator_user.urls")),    # 后台用户管理url
]
